<html>
 <head>
        <title>[var.TITLE]</title>
        <link href="[var.ROOT_CSS_DIR]/main.css" rel="STYLESHEET" type="text/css" charset="iso-8859-1" hreflang="en-us">
        <link href="[var.ROOT_CSS_DIR]/facet/style.css" rel="STYLESHEET" type="text/css" charset="iso-8859-1" hreflang="en-us">
        <script type="text/javascript" src="[var.ROOT_DIR]js/common.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/doiMenuDOM.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/functions.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsmenu.php"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsmenu.cfg"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsformgrid.php?session=[var.SessionVar]"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsmasks.js"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsverify.php?session=[var.SessionVar]"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jsinit.php?session=[var.SessionVar]"></script>
        <script type="text/javascript" src="[var.ROOT_DIR]js/jquery.min.js"></script>
 </head>
 <body bgcolor="FFFFFF" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
         <table border="0" cellspacing="0" cellpadding="0" width="100%" align="[var.POSITION]">
                <tr>
                        <td>[tbs_include.onshow;file=[var.HTMLHeader];getob;]</td>
                </tr>
                <tr>
                        <td>
                        <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                        <td class="mainmenu2"><img src="images/spacer.gif" height="1" width="1"></td>
                                </tr>
                                <tr>
                                        <td background="[var.ROOT_IMG_DIR]/back-menu.gif">
                                        <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                                <tr>
                                                        <td>
                                                        <script language="JavaScript" type="text/JavaScript">menu.Build();</script>
                                                  </td>
                                                  <td class="head-login">Login as [var.USERPROFILE_NAME]</td>
                                                </tr>
                                          </table>
                                        </td>
                                </tr>
                                <tr>
                                        <td class="mainmenu2"><img src="images/spacer.gif" height="1" width="1"></td>
                                </tr>
                        </table>
                        </td>
                </tr>
                <tr height="100%">
                        <td>
                        <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
                                <tr valign="top">
                                        <td width="100%">
                                                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                                        <tr>
                                                                <td class="head-path"></td>
                                                                <td class="corner-date">[var.CORNER_DATE]</td>
                                                        </tr>
                                                </table>
                                                <table border="0" cellspacing="0" cellpadding="5" width="100%">
                                                        <tr>
                                                                <td class="FacetHeaderContent" >.:[var.SubHeaderTitle]:.</td>
                                                        </tr>
                                                </table>

                                                <table border="0" cellspacing="0" cellpadding="5" width="100%">
                                                <form method="post" action="[var.FormAction]" name="[var.HTMLFormName]" ONSUBMIT="if (this.submitted) return true; else return false;">
                                                        <tr>
                                                          <td class="contentTitle">
                                                                Menu
                                                          </td>
                                                        </tr>
                                                        <tr>
                                                          <td class="content2">

                                                                <table cellspacing="2" cellpadding="0">
                                                                 <tr>
                                                                   <td>
                                                                    <input type="button" name="Action" value="<<Back" class="button" onClick="self.location.replace('[sys.script_name]')">
                                                                   </td>
                                                                   <td>[tbs_check;block=td;if [var.USER_CANINSERT]=1][tbs_check;block=td;if [var.USER_CANUPDATE]=1]

                                                                   [tbs_check;htmlconv=no;if [headblv.nk_cancel_status;noerr]!='';then
                                                                   '' ;
                                                                   else
                                                                   '<input name="FormAction" type="submit" value="Save" class="button" ONCLICK="if(checkVerification()) { this.form.submitted = true; }">';
                                                                   selected;noerr]

                                                                   </td>
                                                                   <td>
                                                                    <input type="button" name="Action" value="Done" class="button" onClick="self.location.replace('[var.SERVER_URL]')">
                                                                   </td>
                                                                   <td>[tbs_check;block=td;if [var.FormMode]=Edit]
                                                                    <input type="button" name="Action" value="Print To PDF" class="button" onClick="OpenPDF ('[sys.script_name]?PageMode=PDF&nobkt=[var.PRIMARY_VALUE]');">
                                                                   </td>
                                                                   <td>[tbs_check;block=td;if [var.FormMode]=Edit]
                                                                    <input type="button" name="Action" value="PDF no Logo" class="button" onClick="OpenPDF ('[sys.script_name]?PageMode=PDF_no_logo&nobkt=[var.PRIMARY_VALUE]');">
                                                                   </td>

                                                                   
                                                                   <td>[tbs_check;block=td;if [var.USER_CANPRINT_TAX]=1]
                                                                           <input type="button" name="Action" value="Print Tax Voucher" class="button" onClick="OpenPDF('[sys.script_name]?PageMode=Tax&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&office=[var.KTRASL]')">
                                                                   </td>
                                                                   <!--
                                                                   <td>[tbs_check;block=td;if [var.USER_CANPRINT]=1]
                                                                           <input type="button" name="Action" value="Create New Tax Number" class="button" onClick="self.location.replace('[sys.script_name]?PageMode=Form&Action=CreateFaktur&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&office=[var.KTRASL]')">
                                                                   </td>
                                                                   -->

                                                                   <td>[tbs_check;block=td;if [var.FormMode]=Edit]
                                                                    <input type="button" name="Action" value="New Debit Note" class="button" onClick="self.location.replace('[sys.script_name]?PageMode=Form');">
                                                                   </td>
                                                                   <!-- F
                                                                   <td>[tbs_check;if [headblv.inc_ppn]=1 and [var.FormMode]=Edit]
                                                                    <input type="button" name="Action" value="Print To PDF MTCON" class="button" onClick="OpenPDF ('[sys.script_name]?PageMode=PDF&nobkt=[var.PRIMARY_VALUE]');">
                                                                   </td>
                                                                   -->

                                                                 </tr>
                                                                </table>
                                                          </td>
                                                        </tr>
                                                        <tr>
                                                          <td class="content2">
                                                        <!-- FORM SECTION -->
                                                        <table border="0" cellspacing="0" cellpadding="0" width="100%">

                                                                  <tr>
                                                                    <td class="fieldCaption" align="right">ID No.</td>
                                                                    <td class="fieldCaption" width="2">:</td>
                                                                    <td class="fieldCaption">
                                                                                <input type="text" name="[headbln.nobkt]" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.nobkt] ;else 'AUTO NUMBERED BY SYSTEM']" maxlength="255" size="25" class="input" onchange="this.value=this.value.toUpperCase()" class="input" readonly>
                                                                    </td>

                                                                    <td class="fieldCaption" align="right">Transaction Date</td>
                                                                    <td class="fieldCaption" width="2">:</td>
                                                                    <td class="fieldCaption">
                                                                          <input type="text" name="[headbln.tglbkt]" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.tglbkt;frm='dd/mm/yyyy']; else [sys.now;frm='dd/mm/yyyy']]" maxlength="255" size="10" class="input">
                                                                                <a href="javascript:void(0)" onClick="gfPop.fPopCalendar([var.HTMLFormName].[headbln.tglbkt]);return false;" hidefocus><img name="popcal" align="absMiddle" src="[var.ROOT_DIR]js/Calendar/pop/calbtn.gif" width="34" height="22" border="0" alt=""></a>
                                                                    </td>
                                                                  </tr>

                                                                  <tr>
                                                                    <td class="fieldCaption" align="right">Job Order Ref</td>
                                                                    <td class="fieldCaption" width="2">:</td>
                                                                    <td class="fieldCaption">
                                                                        <select name="joList" id="input" onchange="GetJo();">
                                                                            <option value="" selected>Select Value</option>
                                                                            <option value="1">Job Order</option>
                                                                        </select>                                                                   
                                                                    <input type="hidden" id="jo_ido" name="jo_ido" value="[var.show_jo_id;noerr]" class="input" maxlength="50"  size="10">
                                                                    <input type="text" id="jo_code" name="jo_code" value="[headblv.jo_code;noerr]" maxlength="255" size="40" class="input" readonly>
                                                                    </td>

                                                                   <td class="fieldCaption" align="right">Currency Rate</td>
                                                                   <td class="fieldCaption" width="2">:</td>
                                                                   <td class="fieldCaption">
                                                                   <input type="text" name="[headbln.rate]" value="[headblv.rate;frm='0,000.00']" maxlength="255" size="10" class="inputNumber" readonly>
                                                                   </td>
                                                                  </tr>

                                                                  <tr>

                                                                    <td class="fieldCaption" align="right" valign="top">Debtur</td>
                                                                    <td class="fieldCaption" valign="top">:</td>
                                                                    <td class="fieldCaption">
                                                                       <select name="Debitur_select" class="input" onchange="GetDebtur('debtur');" [tbs_check;if [var.FormMode]=Edit;then 'disabled';else '']>
                                                                          <option value="" selected>Select Value</option>
                                                                          <option value="2">Debtur</option>
                                                                        </select>

                                                                        <input type="text" name="debnam" value="[headblv.debnam]" maxlength="255" size="25" class="input" [tbs_check;if [var.FormMode]=Edit;then 'disabled';else ''] onclick="GetReceived(this.value);" >
                                                                        <input type="hidden" name="debtur" value="[headblv.debtur]" maxlength="255" size="25">
                                                                        <input type="hidden" name="debtur_fin" value="[headblv.debtur_fin;noerr;]" id="debtur_fin" maxlength="255" size="25">
                                                                    </td>


                                                                    <td class="fieldCaption" align="right"></td>
                                                                    <td class="fieldCaption"></td>
                                                                    <td class="fieldCaption"></td>

                                                                  </tr>

                                                                  <tr>
                                                                   <td class="fieldCaption" align="right">Currency</td>
                                                                   <td class="fieldCaption" width="2">:</td>
                                                                   <td class="fieldCaption">
                                                                    <select name="curr" class="input" onChange="GetRate()" >
                                                                          <option value="">-</option>
                                                                          <option value="[currformblk.tusymbol]">[currformblk.tusymbol;block=option]</option>
                                                                          <option>[headblv.curr;selected;noerr]</option>
                                                                        </select>
                                                                   </td>
                                                                   

                                                                    <td class="fieldCaption" align="right">VAT No</td>
                                                                    <td class="fieldCaption" width="2">:</td>
                                                                    <td class="fieldCaption">
                                                                                 <select  name="[headbln.typevat]" class="input">
                                                                                 <option value="[headblv.typevat]">[headblv.typevat]</option>
                                                                                    <option value="010">010</option>
                                                                                        <option value="020">020</option>
                                                                                        <option value="030">030</option>
                                                                                        <option value="040">040</option>
                                                                                        <option value="050">050</option>
                                                                                        <option value="060">060</option>
                                                                                        <option value="070">070</option>
                                                                                        <option value="080">080</option>
                                                                                        <option value="090">090</option>
                                                                                </select>

                                                                                <input type="text" name="[headbln.vat]" value="[headblv.vat]" maxlength="255" size="20" class="input">
                                                                        </td>
                                                                        </td>
                                                                  </tr>


                                                                  <tr>

                                                                        <td class="fieldCaption" align="right" >Include PPN</td>
                                                                        <td class="fieldCaption">:</td>
                                                                        <td class="fieldCaption">
                                                                           <!--<input type="checkbox" name="[headbln.inc_ppn]" value="1" [tbs_check;if [headblv.inc_ppn]=1;then 'checked' ;else '']>-->
                                                                           <select name="[headbln.inc_ppn]" class="input">
                                                                             <option value="">-</option>
                                                                             <option value="[taxRate.tax_id]">[taxRate.description;block=option]</option>
                                                                             <option>[headblv.inc_ppn;selected;noerr]</option>
                                                                           </select>
                                                                        </td>

                                                                        <td class="fieldCaption" align="right">VAT Date</td>
                                                                        <td class="fieldCaption" width="2">:</td>
                                                                        <td class="fieldCaption">
                                                                              <input type="text" name="[headbln.tglvat]" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.tglvat;frm='dd/mm/yyyy']; else [sys.now;frm='dd/mm/yyyy']]" maxlength="255" size="10" class="input" onChange="CheckPeriodVAT()">
                                                                                    <a href="javascript:void(0)" onClick="gfPop.fPopCalendar([var.HTMLFormName].[headbln.tglvat]);return false;" hidefocus><img name="popcal" align="absMiddle" src="[var.ROOT_DIR]js/Calendar/pop/calbtn.gif" width="34" height="22" border="0" alt=""></a>
                                                                        </td>


                                                                  </tr>


                                                                  <tr>

                                                                    <td class="fieldCaption" align="right" valign="top">ND Status</td>
                                                                    <td class="fieldCaption" valign="top">:</td>
                                                                    <td class="fieldCaption">
                                                                       [tbs_check;htmlconv=no;if [headblv.nk_cancel_status]!='';then '<span style="color:#FF0000;">CANCELED</span>' ;else '<span style="color:#348017;">CONTINUE</span>';selected;noerr]
                                                                    </td>


                                                                    <td class="fieldCaption" align="right"></td>
                                                                    <td class="fieldCaption"></td>
                                                                    <td class="fieldCaption"></td>

                                                                  </tr>


                                                                  <tr>

                                                                    <td class="fieldCaption" align="right" valign="top">Nama Paket</td>
                                                                    <td class="fieldCaption" valign="top">:</td>
                                                                    <td class="fieldCaption">
                                                                       <input type="text" name="package_services_name" value="[headblv.package_services_name;noerr]" size="30" class="input"><br/>
                                                                       ("Isi" apabila akan di bentuk sebuah paket, dan "kosongkan" apabila dibiarkan per services)
                                                                    </td>
                                                                    <!--
                                                                        <select name="location" class="input" id="location">
                                                                                      <option value="[locblk.id]">[locblk.code;block=option]</option>
                                                                                      <option>[tbs_check;if [headblv.location]!='';then [headblv.location] ;else '';selected;noerr]</option>
                                                                        </select>
                                                                     -->
                                                                    <td class="fieldCaption" align="right">Ref no.</td>
                                                                    <td class="fieldCaption">:</td>
                                                                    <td class="fieldCaption">
                                                                       <input type="text" name="[headbln.noref]" value="[headblv.noref]" maxlength="255" size="10" class="inputNumber">
                                                                    </td>

                                                                  </tr>




                                                         </table>
                                                         <!-- FORM SECTION -->
                                                                </td>
                                                        </tr>
                                                </table>
                                                <hr size="1" color="DFDFDF">
                                                <div id="spanHeader" style="height: 25px; vertical-align: top; overflow-y: noscroll;">
                                                <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="left">
                                                <input type=hidden name="NewData" value="[var.NewDataStart]">
                                                        <tr>
                                                                <td nowrap class="FacetColumnTD" align="center" width="50">X</td>
                                                                <td nowrap class="FacetColumnTD" align="center" width="50">No.</td>
                                                                <td nowrap class="FacetColumnTD" align="center" width="350">Services</td>
                                                                <td nowrap class="FacetColumnTD" align="center" width="150">Amount</td>
                                                                <td nowrap class="FacetColumnTD" align="center" width="150">COA</td>
                                                                <!--<td nowrap class="FacetColumnTD" align="center" width="150">Order</td>-->
                                                                <!--td nowrap class="FacetColumnTD" align="center" width="250">&nbsp;</td-->
                                                                <td nowrap class="FacetColumnTD" align="center" width="150">UU</td>
                                                                <td class="FacetColumnTD" align="center">&nbsp;</td>
                                                        </tr>
                                                </table>
                                                </div>

                                                <div id="spanDetail" style="height: 200px; vertical-align: top; overflow: auto;">
                                                <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="left">
                                                    <input type=hidden name="NewData" value="[var.NewDataStart]">
                                                    <tr id="[blg.#]" style="display:[blg._display;noerr]">
                                                            <td nowrap class="FacetDataTD" align="center" width="50">
                                                                <input type="checkbox" name="txtCheck[blg.#]" value="[blg.memorial_id]" class="inputRadio">
                                                            </td>
                                                            <td nowrap class="FacetDataTD" align="right" width="50" align="right">
                                                                [blg.#;block=tr].
                                                                <input type="hidden" name="urut[blg.#]" value="[tbs_check;if [blg.urut]!='';then [blg.urut] ;else '[blg.#]']">
                                                                <input type="hidden" name="memorial_id[blg.#]" value="[blg.memorial_id]" maxlength="255" size="25">
                                                                <input type="hidden" name="package_services_name[blg.#]" value="[blg.package_services_name;noerr]" maxlength="255" size="25">
                                                            </td>
                                                            <td nowrap class="FacetDataTD"  width="350" align="center">
                                                                <!--
                                                                <input type="text" name="uraian[blg.#]" value="[blg.uraian]" maxlength="255" size="22" class="input" onChange="this.value=this.value.toUpperCase()">
                                                                <a href="javascript:OpenFreeCalc('[var.HTMLFormName]','uraian[blg.#]', 'jumlah[blg.#]')"><img src="../../images/tigracalc.gif" align="middle" border=0></a>
                                                                -->
                                                                   <!--select name="debturList[blg.#]" id="input" onchange="GetServices(this.value,'[blg.#]');">
                                                                     <option value="" selected>Services</option>
                                                                     <option value="1">Select</option>
                                                                   </select-->
                                                                   <!--input type="hidden" name="services_id[blg.#]" value="[blg.services_id;noerr]" class="input">
                                                                   <input type="hidden" name="services_code[blg.#]" value="[blg.services_code;noerr]" class="input"-->

                                                                   <!--<input type="text" name="uraian[blg.#]" value="[blg.uraian;noerr]" maxlength="255" size="22" class="input">-->

                                                                   <select name="debturList[blg.#]" id="input" onchange="GetServices(this.value,'[blg.#]');">
                                                                     <option value="" selected>Services</option>
                                                                     <option value="1">Select</option>
                                                                   </select>
                                                                   <input type="hidden" name="debtur[blg.#]" value="[blg.debtur;noerr]" maxlength="255" size="10" class="inputNumber">
                                                                   <input type="hidden" name="debnam[blg.#]" value="[blg.debnam;noerr]" maxlength="255" size="40" class="input">
                                                                   <input type="hidden" name="services_id[blg.#]" value="[blg.services_id;noerr]" class="input">
                                                                   <input type="hidden" name="services_code[blg.#]" value="[blg.services_code;noerr]" class="input">
                                                                   <input type="text" name="uraian[blg.#]" value="[blg.uraian;noerr]" maxlength="255" size="25" class="input" readonly>
                                                                   <input type="hidden" name="act_id[blg.#]" value="[blg.act_id;noerr]" class="input" readonly>
                                                                   <input type="hidden" name="services_name[blg.#]" value="[blg.services_name;noerr]" maxlength="255" size="20" class="input" readonly>

                                                                   <!--input type="hidden" name="act_id[blg.#]" value="[blg.act_id;noerr]" class="input" readonly>
                                                                   <input type="hidden" name="services_name[blg.#]" value="[blg.services_name;noerr]" maxlength="255" size="20" class="input" readonly-->
                                                            </td>
                                                            <td nowrap class="FacetDataTD" width="150" align="center">
                                                                <input type="text" name="jumlah[blg.#]" value="[blg.jumlah;frm='0,000.00']" maxlength="255" size="10" class="inputnumber" onKeyUp="document.[var.HTMLFormName].total_trans.value = SumTotal('jumlah',[blg.#])">
                                                                <input type="hidden" name="joactivity_remain_idr[blg.#]" value="[blg.joactivity_remain_idr;frm='0,000.00';noerr]" maxlength="255" size="10" class="inputnumber" onKeyUp="document.[var.HTMLFormName].total_trans.value = SumTotal('jumlah',[blg.#])">
                                                                <input type="hidden" name="joactivity_remain_usd[blg.#]" value="[blg.joactivity_remain_usd;frm='0,000.00';noerr]" maxlength="255" size="10" class="inputnumber" onKeyUp="document.[var.HTMLFormName].total_trans.value = SumTotal('jumlah',[blg.#])">
                                                                <input type="hidden" name="dk[blg.#]" value="K">
                                                            </td>
                                                            <td class="FacetDataTD" width="150" align="center">
                                                                <input type="text" name="skada[blg.#]" value="[blg.skada;block=tr]" maxlength="255" size="10" class="input" onKeyUp="this.blur();openSkada([blg.#]);" onClick="this.blur();openSkada([blg.#]);">
                                                            </td>
                                                            <!--
                                                            <td class="FacetDataTD" width="150" align="center">
                                                                <input type="text" name="noorder[blg.#]" value="[blg.noorder]" maxlength="255" size="10" class="input" onChange="this.value=this.value.toUpperCase()">
                                                            </td>
                                                            -->
                                                            <!--td class="FacetDataTD" width="250" align="center"-->
                                                                <!--
                                                                 <select name="jo_code[blg.#]" class="input">
                                                                   <option value="">-</option>
                                                                   <option value="[nrblk.jo_code]">[nrblk.jo_code;block=option]</option>
                                                                   <option>[blg.jo_code;selected;noerr]</option>
                                                                 </select>
                                                                -->
                                                                <!--input type="hidden" name="noref[blg.#]" value="[blg.noref]" maxlength="255" size="10" class="input">
                                                            </td-->
                                                            <td class="FacetDataTD" width="150" align="center">
                                                                  <select name="kdact[blg.#]" class="input">
                                                                        <option value="">-</option>
                                                                        <option value="[actblk.kdact]">[actblk.kdact;block=option]</option>
                                                                        <option>[blg.kdact;selected;noerr]</option>
                                                                  </select>
                                                            </td>
                                                            <td class="FacetDataTD" align="center">
                                                                 <a href="javascript:OpenRemark([blg.#]);"><img src="../../images/new.gif" align="middle" border=0></a>
                                                                 <input type="hidden" name="uraian_a[blg.#]" value="[blg.uraian_a]">
                                                                 <input type="hidden" name="uraian_b[blg.#]" value="[blg.uraian_b]">
                                                                 <input type="hidden" name="uraian_c[blg.#]" value="[blg.uraian_c]">
                                                                 <input type="hidden" name="uraian_d[blg.#]" value="[blg.uraian_d]">
                                                            </td>
                                                        </tr>
                                                </table>
                                                </div>

                                                <div id="spanDetail999" style="height: 25px; vertical-align: top; overflow: noscroll">
                                                <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="left">
                                                    <tr id="999" style="display:[blg._display;noerr]">
                                                            <td class="FacetDataTD" align="center" width="50">&nbsp;</td>
                                                            <td nowrap class="FacetDataTD" align="right" width="50" align="right">
                                                               999.
                                                            </td>
                                                            <td nowrap class="FacetDataTD"  width="350" align="center">
                                                               <input type="text" name="uraian999" value="[blg9.uraian]" maxlength="255" size="30" class="input" onKeyUp="this.value=this.value.toUpperCase()" >
                                                            </td>
                                                            <td nowrap class="FacetDataTD" width="150" align="center">
                                                               <input type="text" name="total_trans" value="" maxlength="255" size="10" class="inputNumber">
                                                            </td>
                                                                <input type="hidden" name="dk999" value="D">

                                                                <td class="FacetDataTD" width="150" align="center">
                                                                <input type="text" name="skada999" value="[blg9.skada]" maxlength="255" size="10" class="input" onclick="this.blur();openSkadaFiltered(999);" onkeyup="this.blur();openSkadaFiltered(999);">
                                                                </td>

                                                            <!--
                                                            <td class="FacetDataTD" width="150" align="center">
                                                               <input type="text" name="noorder999" value="[blg9.noorder]" maxlength="255" size="6" class="input">
                                                            </td>
                                                            -->
                                                            <td class="FacetDataTD" width="150" align="center">
                                                            </td>
                                                            <td class="FacetDataTD" align="center">
                                                                          <select name="kdact999" class="input">
                                                                                        <option value="">-</option>
                                                                                        <option value="[actblk9.kdact]">[actblk9.kdact;block=option]</option>
                                                                                        <option>[blg9.kdact;selected;noerr]</option>
                                                                          </select>
                                                            </td>

                                                        </tr>
                                                </table>
                                                </div>

                                                <div id="spanButton" style="height: 35px; vertical-align: top; overflow-y: noscroll;">
                                                <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="left">
                                                        <tr>
                                                            <td align="right" class="FacetColumnTD">
                                                                   <table border="0" cellspacing="2" cellpadding="0">[tbs_check;block=table;if [var.PERIOD_OPENED]=1]
                                                                           <tr>
                                                                                   <td>[tbs_check;block=td;if [var.USER_CANINSERT]=1]
                                                                                     [tbs_check;htmlconv=no;if [headblv.nk_cancel_status;noerr]!='';then
                                                                                     '' ;
                                                                                     else
                                                                                     '<input name="FormAction" type="submit" value="Next Line" class="button" onClick="if(CheckPeriod()){return (SetDK(reccount,'K') && AddFormGrid(this,'[var.HTMLFormName].uraian'))}">';
                                                                                     selected;noerr]

                                                                                   </td>
                                                                                   <td>
                                                                                     [tbs_check;htmlconv=no;if [headblv.nk_cancel_status;noerr]!='';then
                                                                                     '' ;
                                                                                     else
                                                                                     '<input name="FormAction" type="button" value="Delete Line" class="button" onClick="DeleteLines()">';
                                                                                     selected;noerr]

                                                                                   </td>
                                                                                   <td>[tbs_check;block=td;if [var.USER_CANINSERT]=1][tbs_check;block=td;if [var.USER_CANUPDATE]=1]
                                                                                     <!--<input name="FormAction" type="submit" value="Save" class="button" ONCLICK="if (CheckPeriod() && VerifyForm(this.form) && CheckAllGrid('[var.HTMLFormName].uraian')) {this.form.submitted = true; return true;}">-->
                                                                                     [tbs_check;htmlconv=no;if [headblv.nk_cancel_status;noerr]!='';then
                                                                                     '' ;
                                                                                     else
                                                                                     '<input name="FormAction" type="submit" value="Save" class="button" ONCLICK="if(checkVerification()) { this.form.submitted = true; }">';
                                                                                     selected;noerr]

                                                                                   </td>

                                                                                   <!--
                                                                                   <td>[tbs_check;block=td;if [var.USER_CANDELETE]=1]
                                                                                     <input type="button" name="Action" value="Delete" class="button" onClick="if (confirm('Are you sure want to delete ?')) {[var.HTMLFormName].action='[sys.script_name]?FormAction=Delete&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&PageMode=Form&form=[var.HTMLFormName]';[var.HTMLFormName].submit();}">
                                                                                   </td>
                                                                                   -->
                                                                                   <td>
                                                                                   <input name="FormAction" type="submit" value="Cancel" class="button" onClick="self.location.replace('[sys.script_name]')">
                                                                                   </td>
                                                                           </tr>
                                                                   </table>
                                                            </td>
                                                                </td>
                                                        </tr>
                                                        </form>
                                                </table>
                                                </div>
                                        </td>
                                </tr>
                        </table>
                        </td>
                </tr>

                <tr>
                        <td>
                        <br>
                        <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                        <td class="footer1"><img src="images/spacer.gif" height="1" width="1"></td>
                                </tr>
                                <!--tr>
                                        <td class="footer2">Prototype Test - Web Application</td>
                                </tr-->
                        </table>
                        </td>
                </tr>
         </table>
 </body>
<iframe width="174" height="189" name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="[var.ROOT_DIR]js/Calendar/pop/ipopeng.htm" scrolling="no" frameborder="0" style="LEFT: -500px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; Z-INDEX: 999"></iframe>
 <script>
 [var.InitFunction]
 SetDK(1,'K');
 document.[var.HTMLFormName].total_trans.value = SumTotal("jumlah","");

 function SetDK(idx,val) {
   eval("dk = document.[var.HTMLFormName].dk"+idx+".value;");
   if (dk=='') eval("document.[var.HTMLFormName].dk"+idx+".value='"+val+"';");
   return true;
 }

 function GetPrincipal() {
       document.[var.HTMLFormName].[headbln.debnam].blur();
       newwin = window.open("ais_transaction_principal.php?FormName=[var.HTMLFormName]","toolcalc","height=400,width=640,noscroll,resizable");

 }

 function GetDebtur(need_another_var) {
            //newwin = window.open("ais_transaction_stafflist.php?FormName=[var.HTMLFormName]&PageMode=DNFormJO&need_another_var="+need_another_var,"toolcalc","height=400,width=640,noscroll,resizable");
            newwin = window.open("ais_transaction_custlist_2.php?FormName=[var.HTMLFormName]&SendToBack=1&PageMode=Test&show_data=all","toolcalc","height=400,width=640,noscroll,resizable");
 }




function checkVerification()
{
    var checksum = 0;
    var errorMsg = "";

    var uraian999 = eval("document.[var.HTMLFormName].uraian999.value");
    var skada999 = eval("document.[var.HTMLFormName].skada999.value");

    if(uraian999 == "")
    {
        errorMsg+= "Uraian on list 999 should not empty\n";
    }

    if(skada999 == "")
    {
        errorMsg+= "COA on list 999 should not empty\n";
    }



    /*
    $(".gridBox:visible").each(function(n) {
        lastname = this.name;
        lastname = lastname.substring(3);
        lastname = parseInt(lastname);

        var services_id = eval("document.[var.HTMLFormName].services_id"+lastname+".value");
        var qty = eval("document.[var.HTMLFormName].qty"+lastname+".value");
        var unit = eval("document.[var.HTMLFormName].unit"+lastname+".value");
        var curr = eval("document.[var.HTMLFormName].curr"+lastname+".value");
        var rate = eval("document.[var.HTMLFormName].rate"+lastname+".value");
        var tax_rate = eval("document.[var.HTMLFormName].tax_rate"+lastname+".value");

        if((services_id != "") && (qty != "") && (unit != "") && (curr != "") && (rate != "") && (tax_rate != ""))
        {
          checksum++;
        }

    });


    if(checksum < 1)
    {
        errorMsg+= "Your grid is not complete\n";
    }
    */


    if(errorMsg != "")
    {
        alert(errorMsg);
        return false;
    }

    else
    {
        if(CheckPeriod())
        {
          return true;
        }

        else
        alert("It is out of the transaction period");
        return false;

    }


}





 function GetServices(val,no_urut) {
      var curr = eval("document.[var.HTMLFormName].curr.value");
      var jo_id = eval("document.[var.HTMLFormName].jo_ido.value");
      var inc_ppn = eval("document.[var.HTMLFormName].inc_ppn.value");
      var debtur_fin = eval("document.[var.HTMLFormName].debtur_fin.value");
      var msgErr = "";

      if(curr == "")
      {
          msgErr+= "Currency tidak boleh kosong\n";
      }

      if(jo_id == "")
      {
          msgErr+= "Job Order tidak boleh kosong\n";
      }

      if(inc_ppn == "")
      {
          msgErr+= "PPN tidak boleh kosong\n";
      }
      
      if(debtur_fin == "")
      {
          msgErr+= "Debtur tidak boleh kosong\n";
      }

      if(msgErr == "")
      {
         newwin = window.open("ais_transaction_serviceslist_dn.php?FormName=[var.HTMLFormName]&no_urut="+no_urut+"&curr="+curr+"&jo_id="+jo_id+"&inc_ppn="+inc_ppn+"&debtur_fin="+debtur_fin,"toolcalc","height=400,width=640,noscroll,resizable");
      }

      else
      {
         alert(msgErr);
      }

 }


 function GetJo() {
            newwin = window.open("ais_transaction_jolist_dn.php?FormName=[var.HTMLFormName]&SendToBack=1", "toolcalc","height=400,width=640,noscroll,resizable");
 }


 function GetReceived(val) {
         switch (val){
                case "1":
                        newwin = window.open("ais_transaction_custlist_dn.php?FormName=[var.HTMLFormName]","toolcalc","height=400,width=640,noscroll,resizable");
                        break;
                case "2":
                        newwin = window.open("ais_transaction_stafflist.php?FormName=[var.HTMLFormName]","toolcalc","height=400,width=640,noscroll,resizable");
                        break;
                case "3":
                        document.[var.HTMLFormName].[headbln.debnam].blur();
                        newwin = window.open("ais_transaction_vendorlist.php?FormName=[var.HTMLFormName]","toolcalc","height=400,width=640,noscroll,resizable");
                        break;
                case "4":
                        document.[var.HTMLFormName].[headbln.debnam].blur();
                        newwin = window.open("ais_transaction_otherlist.php?FormName=[var.HTMLFormName]","toolcalc","height=400,width=640,noscroll,resizable");
                        break;
          }
 }

//dyah.24 juli 2009, modified 27 july 2009
 function CheckPeriod () {
     //if (ledger.length) LoadRPC ("iLoader", "[var.FileName]", "ledger="+ledger+"&trsto=tglbkt");
     var ledger = document.[var.HTMLFormName].tglbkt.value;
     var value = "open";

     var param = 'ledger='+ledger;
     $.ajax({ type: "post", url: "ais_transaction_check_period.php", data: param, dataType: "xml",
         success: function(xml){
            $('status', xml).each(function(i){
               value = $('periodstatus', this).text();
            });
        },
        async:   false,
     });

     if(value == "open"){
        return true;
     }else{
        alert('Invalid Date, Period Already Closed Or Not Yet Opened!');
        return false;
     }
 }

 function CheckPeriodVat () {
         ledger = document.[var.HTMLFormName].tglvat.value;
         if (ledger.length) LoadRPC ("iLoader", "[var.FileName]", "ledger="+ledger+"&trsto=tglvat");
 }
function OpenFreeCalc(formname, desc, total) {
  var ppn;
  if (document.[var.HTMLFormName].[headbln.inc_ppn].checked) ppn=1; else ppn=0;
        newwin = window.open("ais_transaction_freecalc.php?PageMode=Form&desc="+desc+"&total="+total+"&formname="+formname+"&inc_ppn="+ppn,"toolcalc","height=10,width=450,noscroll,resizable")
}

 function OpenPrincipal (number) {
        newwin = window.open("ais_transaction_receipt_entry.php?PageMode=Page2&FormName=[var.HTMLFormName]&Number="+number,"vessel","height=105,width=300,noscroll,noresizable");
 }

 function OpenRemark (number) {
        newwin = window.open("ais_transaction_dn.php?PageMode=Remark&FormName=[var.HTMLFormName]&Number="+number,"remarks","height=105,width=300,noscroll,noresizable");
 }

 function OpenPrint (number) {
        newwin = window.open("ais_transaction_dn.php?PageMode=PrintPreview&nobkt="+number,"print","height=650,width=600,noscroll,noresizable");
 }

 function GetRate() {
         tgl_curr = document.[var.HTMLFormName].tglbkt.value;
         if (tgl_curr.length) LoadRPC ("iLoader", "[var.FileName]", "curr="+document.[var.HTMLFormName].curr.value+"&tglbkt="+tgl_curr);
 }

 function GetSkada() {
         skada1 = document.[var.HTMLFormName].thbl.value;
         if (skada1.length) LoadRPC ("iLoader", "[var.FileName]", "thbl="+document.[var.HTMLFormName].thbl.value);
 }
  function SumTotal (component,urut) {
         oMask = new Mask('#,###.#0', 'number');
         var comp_str = "document.[var.HTMLFormName]."+component;
         var curr = document.[var.HTMLFormName].curr.value;
         var joactivity_remain_idr = eval("document.[var.HTMLFormName].joactivity_remain_idr"+urut+".value") * 1;
         var joactivity_remain_usd = eval("document.[var.HTMLFormName].joactivity_remain_usd"+urut+".value") * 1;
         var jumlah = eval("document.[var.HTMLFormName].jumlah"+urut+".value");

         jumlah = String(jumlah);
         jumlah = (jumlah.replace(/,/g, "")) * 1;


         if(curr == "IDR")
         {
            if(jumlah > joactivity_remain_idr)
            {
                alert("Biaya yang ditagihkan sudah melebihi batas");
            }
         }

         else if(curr == "USD")
         {
            if(jumlah > joactivity_remain_usd)
            {
                alert("Biaya yang ditagihkan sudah melebihi batas");
            }
         }


         var TotalComponent = [var.MaxGrid] + [var.NewDataStart] - 1;
         var sum_all = 0;
         var subtotal = 0;
         var js_str = "";

         for (x=1;x<=TotalComponent;x++) {
               js_str = "subtotal = "+comp_str+x+".value;\n";
               js_dk  = "dk_val = "+"document.[var.HTMLFormName]."+"dk"+x+".value;\n";
               eval (js_str+js_dk);

               if (subtotal.length) subtotal = StrToNumber(subtotal);
               else subtotal = 0;
               if (dk_val=="D") sum_all = sum_all + parseFloat(subtotal);
               else if (dk_val=="K") sum_all = sum_all - parseFloat(subtotal);
         }
         if (sum_all<0) {
                sum_all         = sum_all * -1;
                document.[var.HTMLFormName].dk999.value="D";
         } else document.[var.HTMLFormName].dk999.value="K";
         return oMask.format(sum_all);
 }

 function GetTotal () {
         document.[var.HTMLFormName].total_trans.value = SumTotal("jumlah","");
 }

 function openSkada(idx) {
    tglbkt = document.[var.HTMLFormName].tglbkt.value;
        newwin = window.open("ais_transaction_coapicker.php?idx="+idx+"&FormName=[var.HTMLFormName]"+"&Field=skada"+idx+"&BMode=MEM"+"&period="+tglbkt+"&group=NOTAR","skadasearch","height=400,width=640,noscroll,noresizable");
 }

 /* added by dyah <dyah.mahrani@gmail.com>
 * 23 juli 2009
 * desc: COA filter based on group <payable/receivable>
 * */
 function openSkadaFiltered(idx){
    tglbkt = document.[var.HTMLFormName].tglbkt.value;
    newwin = window.open("ais_transaction_coapicker.php?idx="+idx+"&FormName=[var.HTMLFormName]"+"&Field=skada"+idx+"&BMode=MEM"+"&period="+tglbkt+"&group=AR","skadasearch","height=400,width=640,noscroll,noresizable");
 }

 function getCashType(){
    var frm = document.[var.HTMLFormName].cash_type;
    return frm.options[frm.selectedIndex].value;
 }

 function DeleteLines(){
    $("input[name^=txtCheck]").each(
      function(){
        if($(this).attr('checked')) {
            //alert($(this).val());
            var num = String($(this).attr('name')).replace('txtCheck','');
            //alert('num: ' + num);
            $('tr#'+num).remove();
        }
      }
    );
 }



 </script>
</html>
